import { Component, Input, OnInit } from '@angular/core';

@Component({
  selector: 'app-message',
  templateUrl: './message.component.html',
  styleUrls: ['./message.component.css']
})
export class MessageComponent implements OnInit {
  @Input() type: 'success' | 'failure' = 'success';
  @Input() text: string = '';
  @Input() Show: boolean = false;
  @Input() duration: number = 3000;

  show: boolean = true;

  ngOnInit() {
    // setTimeout(() => {
    //   this.show = this.Show;
    //   setTimeout(() => {
    //     this.show = false;
    //   }, this.duration);
    // }, 100);
  }

  

  getClasses(): string[] {
    return [
      'message',
      'message-' + this.type
    ];
  }
}
